package com.qzw.demo.web.controller;

import com.qzw.common.api.base.PageReq;
import com.qzw.common.api.base.PageResp;
import com.qzw.demo.api.model.Shop;
import com.qzw.demo.api.service.IShopService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: 屈子威
 * @create: 2020-07-14
 * @description:
 **/
@RestController
@RequestMapping("/dm/shop")
@Api(tags = "商品管理")
public class ShopController {
    @Autowired
    private IShopService shopService;

    @GetMapping("/list")
    @ApiOperation("获取所有商品")
    private List<Shop> findAll(){
        return shopService.findAll();
    }

    @GetMapping("/page")
    @ApiOperation("分页获取所有商品")
    private PageResp<Shop> findAllByLimit(PageReq pageReq){
        return shopService.findAll(pageReq);
    }
}
